package ch.supsi.template.money;

public abstract class AbstractMoney implements IMoney {
    // dispatch manuale
    public IMoney add(IMoney m) {
        if (m instanceof Money) {
            return addMoney((Money) m);
        } else {
            return addMoneyBag((MoneyBag) m);
        }
    }

    //livello intermedio, per non esporre i metodi in interfaccia
    abstract IMoney addMoney(Money m);

    abstract IMoney addMoneyBag(MoneyBag b);

}
